import { request } from "@/utils/index.js";
//获取频道列表信息
export const getChannels=()=>{
    return request.get('/channels')
}
//发表文章
export const publishArticle=(params)=>{
    return request.post('/mp/articles?draft=false', params)
}
//获取文章列表数据
export const getArticleList=(params)=>{
    return request.get('/mp/articles', { params })
}

//删除文章列表
export const delArticleList=(id)=>{
    return request.delete(`/mp/articles/${id}`)
}

//获取文章详情数据
export const getArticleInfo=(articleId)=>{
    return request.get(`/mp/articles/${articleId}`)
}

//更新文章信息
export const updArticleInfo=(data)=>{
    return request.put(`/mp/articles/${data.id}?draft=false`, data)
}